package com.csproj.basic.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

import java.io.Serializable;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Objects;


/**
 * @author tyshi
 */
@ApiModel(description = "ElectronicLock @author tyshi")
@Entity
@Table(name = "t_base_electronic_lock_message")
public class ElectronicLockMessage implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    @Column(name = "id")
    private String id;
    
    @ApiModelProperty(value = "设备编号")
    @Column(name = "el_number")
    private String elNumber;

    @ApiModelProperty(value = "调度ID")
    @Column(name = "dispatch_id")
    private String dispatchId;

    public String getDispatchId() {
        return dispatchId;
    }
    public ElectronicLockMessage dispatchId(String dispatchId) {
        this.dispatchId = dispatchId;
        return this;
    }
    public void setDispatchId(String dispatchId) {
        this.dispatchId = dispatchId;
    }

    public String getElNumber() {
        return elNumber;
    }

    public ElectronicLockMessage elNumber(String elNumber) {
        this.elNumber = elNumber;
        return this;
    }

    public void setElNumber(String elNumber) {
        this.elNumber = elNumber;
    }

    @ApiModelProperty(value = "未解析")
    @Column(name = "raw_row")
    private String rawRow;

    public String getRawRow() {
        return rawRow;
    }
    public ElectronicLockMessage rawRow(String rawRow) {
        this.rawRow = rawRow;
        return this;
    }
    public void setRawRow(String rawRow) {
        this.rawRow = rawRow;
    }
    
    @ApiModelProperty(value = "信息头")
    @Column(name = "header")
    private String header;

    public String getHeader() {
        return header;
    }
    public ElectronicLockMessage header(String header) {
        this.header = header;
        return this;
    }
    public void setHeader(String header) {
        this.header = header;
    }

    @ApiModelProperty(value = "信息长度")
    @Column(name = "len")
    private String len;

    public String getLen() {
        return len;
    }
    public ElectronicLockMessage len(String len) {
        this.len = len;
        return this;
    }
    public void setLen(String len) {
        this.len = len;
    }

    @ApiModelProperty(value = "信息ID")
    @Column(name = "mid")
    private String mId;

    public String getMid() {
        return mId;
    }
    public ElectronicLockMessage mId(String mId) {
        this.mId = mId;
        return this;
    }
    public void setMid(String mId) {
        this.mId = mId;
    }

    @ApiModelProperty(value = "锁杆状态（0：正常）")
    @Column(name = "lock_stick_status")
    private Boolean lockStickStatus;

    public Boolean getLockStickStatus() {
        return lockStickStatus;
    }
    public ElectronicLockMessage lockStickStatus(Boolean lockStickStatus) {
        this.lockStickStatus = lockStickStatus;
        return this;
    }
    public void setLockStickStatus(Boolean lockStickStatus) {
        this.lockStickStatus = lockStickStatus;
    }

    @ApiModelProperty(value = "外壳状态（0：正常）")
    @Column(name = "outer_status")
    private Boolean outerStatus;

    public Boolean getOuterStatus() {
        return outerStatus;
    }
    public ElectronicLockMessage outerStatus(Boolean outerStatus) {
        this.outerStatus = outerStatus;
        return this;
    }
    public void setOuterStatus(Boolean outerStatus) {
        this.outerStatus = outerStatus;
    }
    @ApiModelProperty(value = "GPS定位状态（0：正常）")
    @Column(name = "gps_status")
    private Boolean gpsStatus;

    public Boolean getGpsStatus() {
        return gpsStatus;
    }
    public ElectronicLockMessage gpsStatus(Boolean gpsStatus) {
        this.gpsStatus = gpsStatus;
        return this;
    }
    public void setGpsStatus(Boolean gpsStatus) {
        this.gpsStatus = gpsStatus;
    }

    @ApiModelProperty(value = "施封状态（0：解封状态，1：施封状态）")
    @Column(name = "is_locked")
    private Boolean isLocked;

    public Boolean getIsLocked() {
        return isLocked;
    }
    public ElectronicLockMessage isLocked(Boolean isLocked) {
        this.isLocked = isLocked;
        return this;
    }
    public void setIsLocked(Boolean isLocked) {
        this.isLocked = isLocked;
    }

    @ApiModelProperty(value = "开锁状态（0：关锁状态，1：开锁状态）")
    @Column(name = "is_open")
    private Boolean isOpen;

    public Boolean getIsOpen() {
        return isOpen;
    }
    public ElectronicLockMessage isOpen(Boolean isOpen) {
        this.isOpen = isOpen;
        return this;
    }
    public void setIsOpen(Boolean isOpen) {
        this.isOpen = isOpen;
    }

    @ApiModelProperty(value = "纬度（+：北纬，-：南纬）")
    @Column(name = "latitude")
    private float latitude;

    public float getLatitude() {
        return latitude;
    }
    public ElectronicLockMessage latitude(float latitude) {
        this.latitude = latitude;
        return this;
    }
    public void setLatitude(float latitude) {
        this.latitude = latitude;
    }

    @ApiModelProperty(value = "经度 (+:东经, -:西经)")
    @Column(name = "longitude")
    private float longitude ;

    public float getLongitude() {
        return longitude;
    }
    public ElectronicLockMessage longitude(float longitude) {
        this.longitude = longitude;
        return this;
    }
    public void setLongitude(float longitude) {
        this.longitude = longitude;
    }
    @ApiModelProperty(value = "电压（毫伏）")
    @Column(name = "volt")
    private int volt;

    public float getVolt() {
        return volt;
    }
    public ElectronicLockMessage volt(int volt) {
        this.volt = volt;
        return this;
    }
    public void setVolt(int volt) {
        this.volt = volt;
    }

    @ApiModelProperty(value = "速度（km/h）")
    @Column(name = "speed")
    private float speed;

    public float getSpeed() {
        return speed;
    }
    public ElectronicLockMessage speed(float speed) {
        this.speed = speed;
        return this;
    }
    public void setSpeed(float speed) {
        this.speed = speed;
    }

    @ApiModelProperty(value = "移动方向")
    @Column(name = "direction")
    private float direction;

    public float getDirection() {
        return direction;
    }
    public ElectronicLockMessage direction(float direction) {
        this.direction = direction;
        return this;
    }
    public void setDirection(float direction) {
        this.direction = direction;
    }

//    @ApiModelProperty(value = "移动角度")
//    @Column(name = "angle")
//    private int angle;
//
//    public float getAngle() {
//        return angle;
//    }
//    public ElectronicLockMessage Angle(int angle) {
//        this.angle = angle;
//        return this;
//    }
//    public void setAngle(int angle) {
//        this.angle = angle;
//    }

    @ApiModelProperty(value = "高程")
    @Column(name = "altitude")
    private float altitude;

    public float getAltitude() {
        return altitude;
    }
    public ElectronicLockMessage altitude(float altitude) {
        this.altitude = altitude;
        return this;
    }
    public void setAltitude(float altitude) {
        this.altitude = altitude;
    }

    @ApiModelProperty(value = "高度")
    @Column(name = "hight")
    private float hight;

    public float getHight() {
        return hight;
    }
    public ElectronicLockMessage hight(float hight) {
        this.hight = hight;
        return this;
    }
    public void setHight(float hight) {
        this.hight = hight;
    }

    @ApiModelProperty(value = "GPS卫星总数")
    @Column(name = "gps_star_number")
    private int gpsStarNumber;

    public float getGpsStarNumber() {
        return gpsStarNumber;
    }
    public ElectronicLockMessage gpsStarNumber(int gpsStarNumber) {
        this.gpsStarNumber = gpsStarNumber;
        return this;
    }
    public void setGpsStarNumber(int gpsStarNumber) {
        this.gpsStarNumber = gpsStarNumber;
    }

    @ApiModelProperty(value = "GPS卫星编号")
    @Column(name = "gps_star_ids")
    private String gpsStarIds;

    public String getGpsStarIds() {
        return gpsStarIds;
    }
    public ElectronicLockMessage gpsStarIds(String gpsStarIds) {
        this.gpsStarIds = gpsStarIds;
        return this;
    }
    public void setGpsStarIds(String gpsStarIds) {
        this.gpsStarIds = gpsStarIds;
    }

    @ApiModelProperty(value = "北斗卫星总数")
    @Column(name = "bd_star_number")
    private int bdStarNumber;

    public float getBdStarNumber() {
        return bdStarNumber;
    }
    public ElectronicLockMessage bdStarNumber(int bdStarNumber) {
        this.bdStarNumber = bdStarNumber;
        return this;
    }
    public void setBdStarNumber(int bdStarNumber) {
        this.bdStarNumber = bdStarNumber;
    }
    @ApiModelProperty(value = "北斗卫星编号")
    @Column(name = "bd_star_ids")
    private String bdStarIds;

    public String getBdStarIds() {
        return bdStarIds;
    }
    public ElectronicLockMessage bdStarIds(String bdStarIds) {
        this.bdStarIds = bdStarIds;
        return this;
    }
    public void setBdStarIds(String bdStarIds) {
        this.bdStarIds = bdStarIds;
    }

    @ApiModelProperty(value = "GSM信号强度")
    @Column(name = "gsm_signal")
    private int gsmSignal;

    public float getGsmSignal() {
        return gsmSignal;
    }
    public ElectronicLockMessage gsmSignal(int gsmSignal) {
        this.gsmSignal = gsmSignal;
        return this;
    }
    public void setGsmSignal(int gsmSignal) {
        this.gsmSignal = gsmSignal;
    }

    @ApiModelProperty(value = "是否移动")
    @Column(name = "is_moving")
    private int isMoving;

    public float getIsMoving() {
        return isMoving;
    }
    public ElectronicLockMessage IsMoving(int isMoving) {
        this.isMoving = isMoving;
        return this;
    }
    public void setIsMoving(int isMoving) {
        this.isMoving = isMoving;
    }

    @ApiModelProperty(value = "时间")
    @Column(name = "time")
    private ZonedDateTime time;

    public ZonedDateTime getTime() {
        return time;
    }
    
    
    public ElectronicLockMessage time(ZonedDateTime time) {
        this.time = time;
        return this;
    }
    public void setTime(ZonedDateTime time) {
        this.time = time;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
    	 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        return "ElectronicLockMessage{" +
            "ELnumber=" + getElNumber() +
            ", is_locked='" + getIsLocked() + "'" +
            ", is_open='" + getIsOpen() + "'" +
            ", latitude='" + getLatitude() + "'" +
            ", longitude='" + getLongitude() + "'" +
            ", altitude='" + getAltitude() + "'" +
            ", spped='" + getSpeed() + "'" +
            ", hight='" + getHight() + "'" +
            ", direction='" + getDirection() + "'" +
            ", gps_star_number='" + getGpsStarNumber() + "'" +
            ", gps_star_ids='" + getGpsStarIds() + "'" +
            ", bd_star_number='" + getBdStarNumber() + "'" +
            ", bd_star_ids='" + getBdStarIds() + "'" +
            ", gps_signal='" + getGsmSignal() + "'" +
            ", volt='" + getVolt() + "'" +
            ", time='" + getTime().format(formatter) + "'" +
            "}";
    }
}
